<template>
	<div class="login-div" ref="divRef">测试</div>
	<ref-comp ref="loginRef"/>
	<button @click="onLogin">登 录</button>
</template>

<script setup>
import { onMounted, ref } from 'vue';
import RefComp from './components/RefComp.vue';
	//声明响应式数据
	const divRef = ref(null)
	const loginRef = ref(null)

	onMounted(() => {
		console.log('获取到DOM元素：', divRef.value)
	})

	const onLogin = () => {
		if(loginRef.value.verify()) {
			return console.log("ok")
		} 
		console.log("不ok")
	}
</script>

<style scoped>

</style>